package com.example.enums;

/**
 * @author ：chengyoubang
 * @version ：V1.0
 * @program ：first-service
 * @date ：Created in 2023/12/24 15:10
 * @description ：
 */
public enum OppositeSexEnum {
    MEI_YOU("没有",1,0.9),
    HEN_SAO("很少",2,0.95),
    NORMAL("有稳定对象或正常",3,1.0),
    HEN_DUO("很多",4,1.1);
    private String name;
    private Integer type;
    private Double ratio;

    OppositeSexEnum(String name, Integer type, Double ratio) {
        this.name = name;
        this.type = type;
        this.ratio = ratio;
    }

    public static Double getRatio(Integer type){
        for(OppositeSexEnum rest:OppositeSexEnum.values()){
            if(rest.type.equals(type))
                return rest.ratio;
        }
        return null;
    }

}

